Smart ObjectsTM

Smart Objects are the technology that TurboCAD uses to allow the creation and maintenance of graphic entities that contain rules to constrain or modify their states based on geometry and other attributes. By writing your own Smart Objects, you can create an infinite variety of custom behaving graphics. The SDK provides several sample Smart Object extensions written in a variety of languages for you to begin with.

How it Works

Smart Objects are OLE Automation servers, where TurboCAD (or the in process server) is the client. A Smart Object server creates one or more automation objects, through the standard COM creation system. Each automation object must support a standard suite of methods and properties, necessary to support the Smart Objects that they control. See the SmartObject API reference for a complete description of this interface.

Smart Object extensions are loaded when the server first starts up. To be successfully loaded, a Smart Object extension file (a module with a .DLL, .EXE., or .VBP extension) must be located in the Regens subdirectory of the server. Each module in this directory is queried for a type library (or an alternative method for Delphi) that tells TurboCAD what extensions are served by the module. Then the module's automation object(s) are created.

On initialization, the Smart Object server tells TurboCAD the number and types of properties that its graphic supports. Later, TurboCAD will call on the Smart Object server to store and retrieve these properties, and more importantly, will ask the Smart Object server to "regen" its graphics when they have been modified by users. This regen process allows the Smart Object server to maintain its graphics using its own logic.

Sample Projects

In Visual Basic, the Rounded Rectangle and Coordinate Text are explained by complete cookbooks that provide step-by-step instructions for creating the custom object. The other objects will build on the previous Smart ObjectsTM documentation and only discuss the new concepts and issues.

Previous Next

SDK Top API Reference TurboCAD Home Page TurboCAD Programming Forums